
import VueRouter from 'vue-router'
import Layout from '@/components/layout/IndexLayout.vue'
import Login from '@/components/login/IndexLogin.vue'
import Home from '@/components/home/HomeIndex.vue'


const Product = () => import('@/components/product/ProductIndex.vue')
const List = () => import('@/components/product/list/ListIndex.vue')
const Category = () => import('@/components/product/category/CategoryIndex.vue')
const Order = () => import('@/components/order/OrderIndex.vue')
const OrderList = () => import('@/components/order/orderlist/OrderList.vue')
const Collect = () => import('@/components/order/collect/CollectIndex.vue')
const Advert = () => import('@/components/advert/AdvertIndex.vue')
const AdvertList = () => import('@/components/advert/list/AdvertList.vue')
const AddProduct = () => import('@/components/product/list/AddProduct.vue')
export default new VueRouter({
    routes: [
        {
            path: '/',
            component: Layout,
            children: [
                {
                    path: '/',
                    component: Home
                },
                {
                    path: '/product',
                    component: Product,
                    children: [
                        {
                            path: 'list',
                            component: List
                        },
                        {
                            path: 'category',
                            component: Category
                        },
                        {
                            path: 'add-product',
                            name: 'ProductPage',
                            component: AddProduct,
                            meta:{
                                activeMenu:'/product/list'
                            }
                        }
                    ]

                },
                {
                    path: '/order',
                    component: Order,
                    children: [
                        {
                            path: 'order-list',
                            name: 'order-list',
                            component: OrderList
                        },
                        {
                            path: 'collect',
                            name: 'collect',
                            component: Collect
                        }
                    ]
                },
                {
                    path: '/advert',
                    component: Advert,
                    children: [
                        {
                            path: 'advert-list',
                            name: 'advert-list',
                            component: AdvertList
                        }
                    ]
                }

            ]
        },
        {
            path: '/login',
            component: Login
        }
    ]
})
